import {Service} from "adajs";
import {format} from "./../../../lib/helper";

class CourseService extends Service {

    defaultData() {
        return {
            list: []
        }
    }

    onupdate(current, {list}) {
        current.list = list.map(item => {
            let _itme = Object.assign({}, item);
            _itme.time = item.crtTime ? format(new Date(item.crtTime.replace(/\-/g,"/")), 'yyyy-MM-dd') : '--';
            return _itme;
        });
    }
}

export default CourseService;